import React from 'react'

export default class App extends React.Component {
  state = {
    count: 10,
    age: 18,
  }
  handleClick() {
    // 修改state中的值:setState
    this.setState({
      count: this.state.count + 1,
    })
  }
  render() {
    return (
      <>
        <h2>计时器：{this.state.count}</h2>
        <button
          onClick={() => {
            this.handleClick()
          }}
        >
          点击我+1
        </button>
      </>
    )
  }
}
